package com.sk.bilibili.view.fragment;

import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import com.alibaba.android.vlayout.DelegateAdapter;
import com.alibaba.android.vlayout.VirtualLayoutManager;
import com.sk.bilibili.R;
import com.sk.bilibili.callBack.OnScrollBottomListener;
import com.sk.bilibili.databinding.FragmentListBinding;
import com.sk.bilibili.databinding.FragmentRefreshBinding;
import com.sk.bilibili.model.BaseModel;
import com.sk.bilibili.model.BaseRefreshModel;

public abstract class BaseListFragment<M extends BaseModel> extends BaseFragment<FragmentListBinding,M>{

    @Override
    protected void afterSetView() {
        VirtualLayoutManager manager = new VirtualLayoutManager(getContext());
        bind.rvShow.setLayoutManager(manager);
        DelegateAdapter adapter = new DelegateAdapter(manager);
        initAdapter(adapter);
        bind.rvShow.setAdapter(adapter);
    }

    protected abstract void initAdapter(DelegateAdapter adapter);

}